module.exports = function ($scope, $modalInstance, $resource, $modal, item, flag, toaster){
    

    //查询type列表
    $scope.search = function (pageNo){
        var para = {
            'data':$scope.rulesinfo.data,
            'create_by' : $scope.rulesinfo.create_by,
            'pageNo': pageNo || $scope.currentPage,
            'pageSize': $scope.itemsPerPage
        }
        $resource('/api/ac/goc/counselingService/findUserWorkNumList', {}, {}).save(para, function(res){
            if(res.errcode === 0){
                $scope.list = res.data.results;
                $scope.totalItems = res.data.totalRecord;
                $scope.currentPage = pageNo;
            }else{
                toaster.error({title: '', body: res.errmsg});
            }
        });
    }


    init();
    function init(){
        $scope.rulesinfo = flag ? {'flag': true} : angular.copy(item);
        $scope.currentPage = 1;		//当前页码
        $scope.itemsPerPage = 10;	//每页显示几条
        console.log($scope.rulesinfo)
        $scope.search();
    }
  
   
    //取消
    $scope.cancel = function () {
        $modalInstance.dismiss('cancel');
    }
 
};